<include file="__THEME__/header" />
<link href="../Public/css/photo.css" rel="stylesheet" type="text/css" />
<!-- 头部 end -->
<include file="../Public/_mainNav" />
<div class="content_holder">
<div class="content no_bg">
  <div class="main no_l">
    <div class="mainbox">
      <include file="../Public/_isHotList" />
      <div class="mainbox_C">
        <div class="page_title">
          <!-- page_title begin -->
          <h2>编辑{$ts['app']['app_alias']}</h2>
        </div>
        <!-- page_title end -->
        <!-- 切换标签 end  -->
        <div class="lineS_btm lh30 mLR15"> <span class="photo_tit"><strong>{$album.name}</strong></span><a href="{:U('/Manage/album_edit',array(id=>$album['id']))}" class="ml5">[编辑]</a>  (共<span class="cRed">{$album.photoCount}</span>张) | <a href="{:U('/Index/albums',array(uid=>$album['userId']))}">返回全部{$ts['app']['app_alias']}列表</a> </div>
        <div class="photoBox mLR15">
          <div class="order"> 提示：用鼠标拖动{$ts['app']['app_alias']}，然后点击“保存”按钮即可。<br />
            <input type="button" onClick="serialize();return false;" class="btn_b" value="保存" />
          </div>
          <ul id="sortable" class="orderlist">
            <volist name="photos" id="li">
              <li id="{$li.id}"> <a href="{:U('/Index/photo')}&id={$li.id}&aid={$album.id}&uid={$li.userId}" class="preview" rel="__ROOT__/thumb.php?w=400&h=400&t=f&url={$li.savepath|get_photo_url}" title="{$li.name}"><img src="__ROOT__/thumb.php?w=160&h=160&t=f&url={$li.savepath|get_photo_url}" /><br />
                {$li.name|getShort='10'}</a></li>
            </volist>
          </ul>
          <!-- photoBox end  -->
        </div>
        <div class="lh30"><span class="right cGray2">{$album.mTime|friendlyDate}创建</span></div>
        <div class="c"></div>
      </div>
      <div class="c"></div>
    </div>
  </div>
</div>
</div>
<include file="__THEME__/footer" />
<script type="text/javascript" src="../Public/js/ui.core.js"></script>
<script type="text/javascript" src="../Public/js/ui.sortable.js"></script>
<script type="text/javascript">
    var aid = '{$aid}';
$(document).ready(
    function () {
        $("#sortable").sortable();
        $("#sortable").disableSelection();
    }
);

function serialize()
{
    var serial = $('#sortable').sortable("toArray");
    var order = serial.join(',');
    $.post( '{:U('/Manage/save_order')}' ,{order:order,id:aid},function(result){
        if(result == 1){
            ui.success('保存成功');
        }else{
            ui.error('顺序无变化');
        }
    });
};
</script>
